import request from "@/utils/request";

// 商家登录
export const merchantLoginByUsername = (query) => request.post('/api/merchant/loginByUsername', query);
export const listMerchants = (query) => request.get('/api/merchant/listMerchants', { params: query });

// 获取当前商家信息
export const getCurMerchant = () => request.get('/api/merchant/getInfo');

export const freezeMerchantById = (id) => request.get('/api/merchant/freezeById', { params: {id} });
export const unFreezeMerchantById = (id) => request.get('/api/merchant/unFreezeById', { params: {id} });

// 根据id获取商家信息
export const getMerchantById = (query) => request.get('/api/merchant/getById', { params: query });

//保存修改后的商家信息
export const saveUpdatedMerchant = (updatedMerchant) => request.post('/api/merchant/updateMerchant', updatedMerchant);

// 删除商家
export const deleteMerchantById = (id) => request.get('/api/merchant/deleteById', { params: {id} });

export const merchantRegister = (registerData) => request.get('/api/merchant/merchantRegister',{ params: registerData  });